package wjw.mapper;

import com.wjw.mapper.RoadTypeTableMapper;
import com.wjw.model.Road_type_table;
import com.wjw.utils.GetSqlSessionUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class RoadTypeTable {

    private SqlSession sqlsession= GetSqlSessionUtils.getSqlSession();
    private RoadTypeTableMapper mapper=sqlsession.getMapper(RoadTypeTableMapper.class);


    @Test
    public void test01(){
        List<Road_type_table> all = mapper.findAll();
        System.out.println(all);
    }

    @Test
    public void test02(){
        Road_type_table road_type_table = new Road_type_table();
        road_type_table.setRoad_type_name("dadwd");
        mapper.add(road_type_table);
        sqlsession.commit();
    }

    @Test
    public void test03(){
        Road_type_table road_type_table = new Road_type_table();
        road_type_table.setRoad_type_name("安慰法挖");
        road_type_table.setRoad_type_id(3);
        mapper.change(road_type_table);
    }
}
